/*
 * @Author: jingfuu@163.com
 * @Date: 2024-09-14 11:14:27
 * @LastEditTime: 2024-12-04 13:09:59
 * @Description: 定义一个中间件，每次请求大约请求地址
 */
import { Injectable, Logger, NestMiddleware } from '@nestjs/common';
import { Request, Response, NextFunction } from 'express';

@Injectable()
export class LoggerMiddleware implements NestMiddleware {
  private readonly logger = new Logger(LoggerMiddleware.name);

  use(req: Request, res: Response, next: NextFunction) {
    this.logger.log('Request url:' + req.url);
    next(); // 放行
  }
}
